import {defineStore} from 'pinia'

export const useLineStore = defineStore("line", {
  state() {
    return {
      lines: [],
      path: false,
    }
  },
  getters: {
    getPath: (state) => state.path,
    getLines: (state) => state.lines,
  },
  actions: {
    updatePath(path) {
      this.path = path
    },
    setLines(list) {
      this.lines = list
    },
    updateLines(line) {
      let list = this.lines
      list.unshift(line)
      this.lines = list
    },
  }
})
